package com.jing21.learn.elasticsearch.intf.model;

import com.google.gson.annotations.SerializedName;
import com.jing21.learn.elasticsearch.intf.annotaion.DisableSourse;
import com.jing21.learn.elasticsearch.intf.annotaion.ESField;
import com.jing21.learn.elasticsearch.intf.enums.EsIndexTypeEnum;
import io.searchbox.annotations.JestId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 朋友圈 对应的elastic 文档类
 *
 * @author zhengjing
 * @version 1.0
 * @date: 2017/10/19 16:37
 */
@Data
@ApiModel("文章")
@DisableSourse
public class Article extends BaseIndexPo {

    @JestId
    @ESField(sort = "desc")
    @ApiModelProperty("序列")
    private Long id;

    @ApiModelProperty("分类")
    private String type;

    @ApiModelProperty("标题")
    private String title;

    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("状态")
    private Integer state;

    @ApiModelProperty("添加时间")
    @SerializedName("add_time")
    @ESField("add_time")
    private LocalDateTime addTime;

    @ApiModelProperty("阅读数")
    private Long readnum;

    @Override
    public EsIndexTypeEnum getEsIndexType() {
        return EsIndexTypeEnum.FRIEND_CRICLE;
    }

}
